#交叉编译工具链信息
SET(Platform ${PLATFORM})
if (NOT DEFINED PLATFORM)
	MESSAGE(STATUS "use default compiler")
else()
	if(${PLATFORM} STREQUAL "rv1109")
		add_definitions(-DRV1109)
		SET(CMAKE_C_COMPILER "/opt/rv1109/bin/arm-linux-gnueabihf-gcc")
		SET(CMAKE_CXX_COMPILER "/opt/rv1109/bin/arm-linux-gnueabihf-g++")
	elseif(${PLATFORM} STREQUAL "sv510")
		add_definitions(-DSV510)
		SET(CMAKE_C_COMPILER "/opt/sv510/bin/arm-linux-gnueabihf-gcc")
		SET(CMAKE_CXX_COMPILER "/opt/sv510/bin/arm-linux-gnueabihf-g++")
	elseif(${PLATFORM} STREQUAL "dv300")
		add_definitions(-DDV300)
		SET(CMAKE_C_COMPILER "/opt/dv300/bin/arm-himix200-linux-gcc")
		SET(CMAKE_CXX_COMPILER "/opt/dv300/bin/arm-himix200-linux-g++")
	elseif(${PLATFORM} STREQUAL "t31")
		add_definitions(-DT31)
		SET(CMAKE_C_COMPILER "/opt/t31/bin/mips-linux-gnu-gcc")
		SET(CMAKE_CXX_COMPILER "/opt/t31/bin/mips-linux-gnu-g++")
	elseif(${PLATFORM} STREQUAL "x86")
		add_definitions(-DX86)
		SET(CMAKE_C_COMPILER "gcc")
		SET(CMAKE_CXX_COMPILER "g++")
	else()
		#默认gcc/g++
		SET(CMAKE_C_COMPILER "gcc")
		SET(CMAKE_CXX_COMPILER "g++")
		MESSAGE(FATAL_ERROR "unsupport compile platform")
	endif()
	message(STATUS "Compile Platform->)" ${Platform})
endif()


if (CMAKE_CL_64)
    set(ADDRESS_MODEL 64)
    set(NODE_TARGET x64)
else()
    MESSAGE(STATUS "32 bit compile")
endif()

include_directories(${PROJECT_SOURCE_DIR}/../Depend/${PLATFORM})
link_directories(${PROJECT_SOURCE_DIR}/Build/${PLATFORM})

SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/Bin/${PLATFORM}/)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Build/${Platform})